/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model;

/**
 *
 * @author Diego
 */
public class Direccion {
        
    private String entero;
    private String hexadecimal;
    private String binario;
    
    

    
    /**
     * @return the ent
     */
    public String getEntero() {
        return entero;
    }

    /**
     * @param ent the ent to set
     */
    public void setEntero(String ent) {
        this.entero = ent;
        this.hexadecimal = (Integer.toHexString(Integer.parseInt(ent))).toUpperCase();
        this.binario = Integer.toBinaryString(Integer.parseInt(ent));
    }
    

    /**
     * @return the hexa
     */
    public String getHexadecimal() {
        return hexadecimal;
    }

    /**
     * @param hexa the hexa to set
     */
    public void setHexadecimal(String hexa) {
        this.hexadecimal = hexa.toUpperCase();
        this.entero = Integer.toString(Integer.parseInt(hexa, 16));
        this.binario = Integer.toBinaryString(Integer.parseInt(this.entero));

    }

    /**
     * @return the bin
     */
    public String getBinario() {
        return binario;
    }

    
    
    public void setBinario(String bin) {
        this.binario = bin;
        this.entero = Integer.toString(Integer.parseInt(bin, 2));
        this.hexadecimal = (Integer.toHexString(Integer.parseInt(entero))).toUpperCase();
        
    }
    
}
